<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<button onclick="foo1()">弹出计算题</button>
		
		<script>
			//产生两个随机数，询问用户计算结果
			function foo1()
			{
				var N1 = Math.floor(Math.random()*10)
				var N2 = Math.floor(Math.random()*10)
				
				var result = prompt(N1+"+"+N2+"=")
				if(result == N1 + N2 )
				{
					alert("计算正确！")
				}
				else{
					alert("计算错误！")
				}
			}
		</script>
	</body>
</html>